package com.snacksmall.controller;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.snacksmall.dto.Dto;
import com.snacksmall.model.News;
import com.snacksmall.service.INewsService;

@Controller
@RequestMapping("/news")

public class NewsController {
	@Resource
	private INewsService newsService;
	@RequestMapping("/findAll.do")
	@ResponseBody
	public Object findAll(Dto dto) {
		List<News> list = newsService.findAll(dto);
		return list;	
	}
	@RequestMapping("/num.do")
	@ResponseBody
	public int num() {
		int num = newsService.num();
		return num;
		
	}

	
}
